<template>
    <section>
        <button @click="handlePost">AJAX请求</button>
        <div id="box">
            <h2>{{data.title}}</h2>
            <p>发布时间：{{data.publish_time}}</p>
            <p v-html="data.content"></p>
        </div>
    </section>
</template>

<script>

import {ajax} from '../../util/request.js';

export default {
    name: "HelloAxios",
    data() {
        return {
            data: {},
            formData: {
                t_content_pk: 1210
            }
        }
    },
    methods: {
        async handlePost() {
            alert(123);
            let res = await ajax("/content/queryRow",this.formData)
            if (res.data.status >= 1) {
                this.data = res.data.result_data;
            }
        }
    }
}
</script>

<style scoped>

</style>